import {
    ToggleComponent,
    MenuComponent,
    ScrollComponent,
    DrawerComponent
} from "@/assets/js";

/**
 * @description Initialize KeenThemes custom components
 */
const initializeComponents = () => {
    setTimeout(() => {
        ToggleComponent.bootstrap();
        MenuComponent.bootstrap();
        ScrollComponent.bootstrap();
        DrawerComponent.bootstrap();
    }, 0);
};

/**
 * @description Reinitialize KeenThemes custom components
 */
const reinitializeComponents = () => {
    setTimeout(() => {
        ToggleComponent.reinitialization();
        MenuComponent.reinitialization();
        reinitializeScrollComponent().then(() => {
            ScrollComponent.updateAll();
        });
        DrawerComponent.reinitialization();
    }, 0);
};

const reinitializeScrollComponent = async () => {
    await ScrollComponent.reinitialization();
};

export {
    initializeComponents,
    reinitializeComponents,
    reinitializeScrollComponent,
};